
Ext.namespace('GBIF.GeoSpatial');

GBIF.GeoSpatial.FeatureGrid = function(config){
	 //var vecLayer = new OpenLayers.Layer.Vector("vector");

	var Employee = Ext.data.Record.create([
	   		{name: 'Fid', mapping: 'Fid'}     
	   ,	{name: 'id', mapping: 'id'}
	   ,	{name: 'Data_Provider_id', mapping: 'Data_Provider_id'}  
	   ,	{name: 'institution_code_id', mapping: 'institution_code_id'}
	   ,	{name: 'collection_code_id', mapping: 'collection_code_id'}
	   ,	{name: 'catalogue_number_id', mapping: 'catalogue_number_id'}
	   ,	{name: 'taxon_concept_id', mapping: 'taxon_concept_id'}
	   ,	{name: 'taxon_name_id', mapping: 'taxon_name_id'}
	   ,	{name: 'kingdom_concept_id', mapping: 'kingdom_concept_id'}
	   ,	{name: 'modified', mapping: 'modified'}
	]);

	var myReader = new Ext.data.XmlReader({
	   		totalProperty: "results" 
	   ,	record: "row"        
	   ,	idProperty: "id"         
	   ,	messageProperty: "msg"   
	}, Employee);

	var store = new Ext.data.Store({
        	proxy: new Ext.data.HttpProxy({url: "../../resources/xml/name.xml"})
		,	reader:new Ext.data.XmlReader({
				   		totalProperty: "results" 
				   ,	record: "row"        
				   ,	idProperty: "id"         
				   ,	messageProperty: "msg"   
				}, Employee)
		,	autoLoad: true	
    });

	Ext.apply(this,config,{
			title: "Feature Grid"
        ,	region: "east"
        ,	store: store
        ,	width: 320
        ,	columns: [{
	            	header: "Fid"
	            ,	width: 200
	            ,	dataIndex: "Fid"
        	} 
			,{
	            	header: "id"
	            ,	width: 200
	            ,	dataIndex: "id"
        	} 
			,{
	            	header: "Data_Provider_id"
	            ,	width: 200
	            ,	dataIndex: "Data_Provider_id"
        	} 
			,{
	            	header: "institution_code_id"
	            ,	width: 200
	            ,	dataIndex: "institution_code_id"
        	} 
			,{
	            	header: "collection_code_id"
	            ,	width: 200
	            ,	dataIndex: "collection_code_id"
        	} 
			,{
	            	header: "catalogue_number_id"
	            ,	width: 200
	            ,	dataIndex: "catalogue_number_id"
        	} 
			,{
	            	header: "taxon_concept_id"
	            ,	width: 200
	            ,	dataIndex: "taxon_concept_id"
        	} 
			,{
	            	header: "taxon_name_id"
	            ,	width: 200
	            ,	dataIndex: "taxon_name_id"
        	} 
			,{
	            	header: "kingdom_concept_id"
	            ,	width: 200
	            ,	dataIndex: "kingdom_concept_id"
        	} 
			,{
	            	header: "modified"
	            ,	width: 100
	            ,	dataIndex: "modified"
        	}]
		
        ,	sm: new GeoExt.grid.FeatureSelectionModel() 
	});
	GBIF.GeoSpatial.FeatureGrid.superclass.constructor.call(this, config)
}
Ext.extend(GBIF.GeoSpatial.FeatureGrid, Ext.grid.GridPanel, {

});